package bible.sunflower.work.yinfeng.ui;

import java.util.HashMap;
import java.util.Map;

public class PageCond implements Cloneable {
	
	//分页查询条件，返回记录的起始记录号
		private Integer begin = 0;
		//分页查询条件，返回记录数长度
		private Integer length = 3;
		//分页查询条件，是否统计总行数
		private Boolean isCount = false;
		//分页状态信息，总记录数
		private Integer count = 0;
		//分页状态信息，总页数
		private Integer totalPage = 0;
		//分页状态信息，当前页号
		private Integer currentPage = 1;
		//分页状态信息，是否首页
		private Boolean isFirst = true;
		//分页状态信息，是否尾页
		private Boolean isLast = false;
		//分页状态信息，当前页记录数
		private Integer size = 0;
	
	public void changePageInfo( Integer begin, Boolean isFirst, Boolean isLast, Integer size){
		this.begin = begin;
		this.isFirst = isFirst;
		this.isLast = isLast;
		this.size = size;
	}
	
	public Map<String, Object> getPageParam(){
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("page/begin", begin);
		paramMap.put("page/length", length);
		paramMap.put("page/isCount", isCount );
		paramMap.put("page/isFirst", isFirst );
		paramMap.put("page/isLast", isLast );
		return paramMap;
	}
	
	public Integer getBegin() {
		return begin;
	}
	public void setBegin(Integer begin) {
		this.begin = begin;
	}
	public Integer getLength() {
		return length;
	}
	public void setLength(Integer length) {
		this.length = length;
	}
	public Boolean getIsCount() {
		return isCount;
	}
	public void setIsCount(Boolean isCount) {
		this.isCount = isCount;
	}
	public Integer getCount() {
		return count;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public Integer getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public Integer getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}
	public Boolean getIsFirst() {
		return isFirst;
	}
	public void setIsFirst(Boolean isFirst) {
		this.isFirst = isFirst;
	}
	public Boolean getIsLast() {
		return isLast;
	}
	public void setIsLast(Boolean isLast) {
		this.isLast = isLast;
	}
	public Integer getSize() {
		return size;
	}
	public void setSize(Integer size) {
		this.size = size;
	}
	
	public PageCond clone() { 
		PageCond o = null; 
		try { 
		o = (PageCond)super.clone(); 
		} catch (CloneNotSupportedException e) {} 
		return o;
		}
	

}
